﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.SqlClient;
using System.Collections;

    public class PHIEUXUAT_BUSSINESS
    {
        public DataSet ListPHIEUXUAT(PHIEUXUAT_ENTITY px)
        {
            string ACTION = "LIST_PX";
            return PHIEUXUAT_DATAACCESS.GETDATATABLE(ACTION, px);
        }
        public DataSet TTPHIEUXUAT(PHIEUXUAT_ENTITY px)
        {
            string ACTION = "GETBYID";
            return PHIEUXUAT_DATAACCESS.GETDATATABLE(ACTION, px);
        }
        public int GetMAXID(PHIEUXUAT_ENTITY px)
        {
            string ACTION = "MAXID";
            return PHIEUXUAT_DATAACCESS.MAXID(ACTION, px);
        }
        public void ThemPX(PHIEUXUAT_ENTITY px)
        {
            string ACTION = "INSERT";
            PHIEUXUAT_DATAACCESS.ExcuteQueryString(ACTION, px);
        }
        public void SuaPX(PHIEUXUAT_ENTITY px)
        {
            string ACTION = "UPDATE";
            PHIEUXUAT_DATAACCESS.ExcuteQueryString(ACTION, px);
        }
        public void LuuPX(PHIEUXUAT_ENTITY px)
        {
            string ACTION = "SAVE";
            PHIEUXUAT_DATAACCESS.ExcuteQueryString(ACTION, px);
        }
        public void XoaPX(PHIEUXUAT_ENTITY px)
        {
            string ACTION = "DELETE";
            PHIEUXUAT_DATAACCESS.ExcuteQueryString(ACTION, px);
        }
        public Hashtable HashListPX(PHIEUXUAT_ENTITY px)
        {
            string ACTION = "LIST";
            Hashtable ht = new Hashtable();
            DataSet ds = PHIEUXUAT_DATAACCESS.GETDATATABLE(ACTION, px);
            if (ds.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    ht.Add(dr["MAPX"], dr["MAPX"]);
                }
            }
            return ht;
        }
    }
